<template>
  <ElDialog
    v-model="dialogVisible"
    title="库存分配"
    width="800px"
    :close-on-click-modal="false"
    destroy-on-close
  >
    <div>库存分配功能开发中...</div>

    <template #footer>
      <ElSpace>
        <ElButton @click="handleCancel">取消</ElButton>
        <ElButton type="primary" @click="handleSubmit">确定</ElButton>
      </ElSpace>
    </template>
  </ElDialog>
</template>

<script setup lang="ts">
import { computed } from "vue";

defineOptions({ name: "WmsInventoryAllocateDialog" });

// Props
interface Props {
  visible: boolean;
  selectedRows?: WMS.Inventory.InventoryInfo[];
}

const props = withDefaults(defineProps<Props>(), {
  visible: false,
  selectedRows: () => [],
});

// Emits
interface Emits {
  (e: "update:visible", visible: boolean): void;
  (e: "submit"): void;
}

const emit = defineEmits<Emits>();

// 弹窗状态
const dialogVisible = computed({
  get: () => props.visible,
  set: (value) => emit("update:visible", value),
});

// 取消
const handleCancel = () => {
  dialogVisible.value = false;
};

// 提交
const handleSubmit = () => {
  dialogVisible.value = false;
  emit("submit");
};
</script>
